package org.dding.msc.service.impl;

import org.dding.msc.exception.StartException;
import org.dding.msc.exception.WaitingException;
import org.dding.msc.service.Service;
import org.dding.msc.service.StartContext;
import org.dding.msc.service.StopContext;

/**
 * An abstract service class which provides default implementations.
 * 
 * @param <T>
 *            the value type
 * 
 */
public abstract class AbstractService<T> implements Service<T> {

	/** {@inheritDoc} This implementation does nothing. */
	public void start(final StartContext context) throws StartException {
	}

	/** {@inheritDoc} This implementation does nothing. */
	public void stop(final StopContext context) {
	}

	/** {@inheritDoc} This implementation returns {@code null}. */
	public T getValue() throws IllegalStateException {
		return null;
	}

	public void waiting(boolean enable) throws WaitingException {
	}
}
